package com.seckill.model.dto;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author lill
 * @date 2019-06-25
 */
@Data
public class ItemDTO implements Serializable {

    private static final long serialVersionUID = 2778111153054555565L;

    private Integer id;

    @NotBlank(message = "商品名称不能为空")
    private String title;

    @NotNull(message = "商品价格不能为空")
    @Min(value = 0, message = "商品价格要大于0")
    private BigDecimal price;

    @NotNull(message = "商品库存不能为空")
    private Integer stock;

    @NotBlank(message = "商品描述不能为空")
    private String description;

    private Integer sales;

    @NotBlank(message = "商品图片不能为空")
    private String imgUrl;

    /**
     * 使用聚合模型,如果promoModel不为空，则表示其拥有还未结束的秒杀活动
     */
     private PromoDTO promoDTO;
}
